Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds interactive nudge status updates to the report bot, giving users the ability to mark work items as done or change their status directly from Slack DMs. It also hardens the LLM JSON response parsing by repairing malformed confidence values.
Changes:
- Interactive nudge rendering:
RenderNudgeForUsernow fetches per-user active work items, deduplicates them, paginates them, and renders Slack Blocks with "Mark as Done" and overflow status-change buttons — replacing the previous generic text-only message. - Slack block-action handlers: New handlers for
nudge_done,nudge_more,nudge_page_prev/nextactions, including authorization (the acting user must be the nudge recipient) and ownership checks before mutating work-item status and refreshing the in-place message. - LLM confidence repair:
parseSectionClassifiedResponsenow attempts to repair malformed LLM output (e.g.,0. Nineornopeas confidence values) before failing, with prompt instruction hardening and regression tests.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
internal/storage/sqlite/db.go |
New UpdateWorkItemStatus function for status-only updates |
internal/storage/sqlite/db_test.go |
Test coverage for the new function |
internal/nudge/nudge.go |
Core rendering, pagination, deduplication, and name-matching logic for interactive nudges |
internal/nudge/deps.go |
Adds WorkItem type alias and GetItemsByDateRange wrapper for the nudge package |
internal/nudge/nudge_render_test.go |
Tests for RenderNudgeForUser covering generic, paginated, and updated-no-items paths |
internal/integrations/slack/slack.go |
Block-action dispatch and handler functions for done/more/page nudge interactions |
internal/integrations/slack/deps.go |
Action-ID constants, UpdateWorkItemStatus, RenderNudgeForUser, and updated sendNudges wrappers |
internal/integrations/slack/nudge_interaction_test.go |
Integration tests for all four nudge block-action flows |
internal/integrations/llm/llm.go |
repairSectionClassifiedResponse and helpers to normalize malformed confidence literals |
internal/integrations/llm/llm_test.go |
Regression tests for the confidence repair and normalizeConfidenceLiteral |
internal/app/app.go |
Passes db to the updated StartNudgeScheduler signature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LLM confidence parsing fix
confidenceliterals before JSON parse0. Nine/0. nineas0.90for unrecoverable confidence values instead of failing the whole batchinternal/integrations/llm/llm_test.goTesting
GOCACHE=/tmp/reportbot-go-cache go test ./internal/integrations/llm ./internal/nudge ./internal/storage/sqliteGOCACHE=/tmp/reportbot-go-cache go test ./internal/integrations/slack -run 'TestHandleBlockActions_Nudge'Notes
go test ./...remains blocked in this environment by existing tests that usehttptestlisteners